﻿<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeFile="JokeTempList.aspx.cs" Inherits="EditDownload_Joke_JokeTempList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>下载列表</title>
    <script src="../../js/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
//        function showText(obj) {
//            var html = obj.innerHTML;
//            document.getElementById("txtArea").value = html;

//        }
//        function changeText() {
//            var rmv = document.getElementById("removeText").value;
//            var text = document.getElementById("txtArea").value;
//            var result = text.replace(new RegExp(rmv, "gi"), "");
//            document.getElementById("show").innerHTML = result;
//            document.getElementById("txtArea").value = result;
        //        }
        $(document).ready(function() {
            $("textarea").each(function() {
                $(this).css("height", $(this)[0].scrollHeight);
            });

//            $('#txtReplaceBe').val("&nbsp;");
//            
//            $('#commonWord').change(function() {
//                var v = $(this).val();
//                $('#txtReplaceBe').val($(this).val());
//            });
        });

        var prevResult = "";
        function replaceText() {
            var replaceBe = document.getElementById("txtReplaceBe").value;
            var replaceTo = document.getElementById("txtReplaceTo").value;
            var content = document.getElementById("txtEdit").value;
            prevResult = content;//保存前一次结果
            
            var result = content.replace(new RegExp(replaceBe, "gi"), replaceTo);
            document.getElementById("editResult").innerHTML = result;
            document.getElementById("txtEdit").value = result;
        }

        function cancelChange() {
            document.getElementById("editResult").innerHTML = prevResult;
            document.getElementById("txtEdit").value = prevResult;
        }
    </script>
    <style type="text/css">
        td{border:solid 1px #69a;}
        input{ background:#eee; font-size:14px;}
    </style>
</head>
<body>
        <%--<div id="show"></div>
        <input type="text" id="removeText" />
    <input type="button" id="change" onclick="changeText();" value="change text" />
    <asp:Button ID="postBtn" runat="server" Text="post" onclick="postBtn_Click" />
    <asp:TextBox ID='txtArea' runat="server" TextMode="MultiLine" style="width:100%; height:100%"></asp:TextBox>
    <asp:Label ID="showResult" runat="server"></asp:Label>--%>
    <hr />
<form id="form1" runat="server">     

    <div>
       <table cellpadding="15px" cellspacing="5px">
            <tr>                
                <td>
                    标题<asp:TextBox ID="txtTitle" runat="server" Width="300px"></asp:TextBox>
                    <asp:DropDownList ID="DropDownListType" runat="server">
                        <asp:ListItem Value="30">动物</asp:ListItem>
                        <asp:ListItem Value="31">人物</asp:ListItem>
                        <asp:ListItem Value="32">夫妻</asp:ListItem>
                        <asp:ListItem Value="33">植物</asp:ListItem>
                        <asp:ListItem Value="34">冷笑话</asp:ListItem>
                        <asp:ListItem Value="35">社会</asp:ListItem>
                        <asp:ListItem Value="36">综合</asp:ListItem>
                        <asp:ListItem Value="37">职场</asp:ListItem>
                        <asp:ListItem Value="38">校园</asp:ListItem>
                        <asp:ListItem Value="39">爱情</asp:ListItem> 
                        <asp:ListItem Value="40">体育</asp:ListItem>
                        <asp:ListItem Value="41">男女</asp:ListItem>
                        <asp:ListItem Value="42">家庭</asp:ListItem>
                        <asp:ListItem Value="43">荤段子</asp:ListItem>
                        <asp:ListItem Value="44">另类</asp:ListItem>
                        <%--
                        <asp:ListItem Value="45"></asp:ListItem>       --%>                
                    </asp:DropDownList>

                    <asp:DropDownList ID="DropDownListLevel" runat="server">
                        <asp:ListItem>1</asp:ListItem>
                        <asp:ListItem>2</asp:ListItem>
                        <asp:ListItem>3</asp:ListItem>
                        <asp:ListItem>4</asp:ListItem>
                        <asp:ListItem Selected="True">5</asp:ListItem>
                        <asp:ListItem>6</asp:ListItem>
                        <asp:ListItem>7</asp:ListItem>
                        <asp:ListItem>8</asp:ListItem>
                        <asp:ListItem>9</asp:ListItem>
                        <asp:ListItem>10</asp:ListItem>
                    </asp:DropDownList>  
                </td>
                <td>
                    <%--显示第<asp:TextBox ID="txtStartNumber" runat="server" Width="50px" Text="0"></asp:TextBox>条。  --%>                  
                    ID=<b><asp:Label ID="labelJokeId" runat="server"></asp:Label></b> , <asp:Label ID="labelSiteKindId" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Button  ID="btnNext" runat="server" Text="显示下一条" onclick="btnNext_Click" />
                    &nbsp;&nbsp;
                    <asp:Button  ID="btnSaveAndNext" runat="server" Text="保存并显示下一条" onclick="btnSaveAndNext_Click" />                    
                    &nbsp;&nbsp;                  
                    <asp:Button  ID="btnDeleteAndNext" runat="server" Text="删除" onclick="btnDeleteAndNext_Click" />
                </td>
                <td>
                    <%--<select id="commonWord">
                        <option value="  ">  </option>
                        <option value="\s+">\s+</option>
                        <option value="<font>">font</option>
                        <option value="</font>">/font</option>
                        <option value='<font face="Verdana">'>font face=Verdana</option>                     
                    </select>--%>
                    
                    将文字:<input type="text" id="txtReplaceBe" Width="100px"  />
                    替换为<input type="text" id="txtReplaceTo" Width="100px" />
                    <input type="button" id="btnRemove" onclick="replaceText();" value="替换内容" />&nbsp;&nbsp;
                    <input type="button" id="Button1" onclick="cancelChange();" value="取消" />                     
                </td>                
            </tr>
       </table> 
        
    </div>
    
    <div>     
        
        <table style="font-size:12px">
            <tr>
                <td width="50%" >
                     编辑后：
                    <textarea id="txtEdit" runat="server" style="width:95%; overflow:visible; padding:10px; margin:10px;"></textarea>
                </td>
                <td width="50%">
                    原始：<%--textarea : IE 可以用 overflow:visible; 自适应高度，不认js. 其他不认overflow认js--%>
                    <textarea id="original" runat="server" style="width:95%; overflow:visible; padding:10px; margin:10px;"></textarea>  
                   
                </td>
            </tr>
            
            <tr style=" background:#ddd;">
                <td width="50%">                            
                    <asp:Label ID="editResult" runat="server"></asp:Label>
                    <%--<div id="editResult"><% --显示编辑结果-- %>
                        <asp:Label ID="labelContentEidted" runat="server"></asp:Label>
                    </div> --%>  
                </td>
                <td width="50%">
                    <div>
                        <asp:Label ID="labelContentOriginal" runat="server"></asp:Label>
                    </div>
                </td>
            </tr>
        </table>                            
            
    </div>
</form> 
</body>
</html>
